package com.go.where.manager.action.go;

import javax.annotation.Resource;

import org.apache.log4j.Logger;

import com.go.where.manager.action.SuperAction;
import com.go.where.manager.common.Constants;
import com.go.where.manager.page.Pagination;
import com.go.where.manager.pojo.CustomerScoreInfo;
import com.go.where.manager.service.CustomerScoreService;
import com.go.where.manager.util.CommonUtil;
import com.google.gson.Gson;

public class CustomerScoreAction extends SuperAction {

	private static final long serialVersionUID = 1L;
	private static final Logger log = Logger
			.getLogger(CustomerScoreAction.class);
	@Resource(name = "customerScoreService")
	private CustomerScoreService customerScoreService;
	private CustomerScoreInfo customerScoreInfo;
	private CustomerScoreInfo customerScoreInfoQuery;
	private String id;
	public Pagination<?> page;

	Gson gson = CommonUtil.gson();

	/**
	 * 查询列表
	 * 
	 * @return
	 */
	public String list() {
		if (customerScoreInfoQuery == null) {
			customerScoreInfoQuery = new CustomerScoreInfo();
			customerScoreInfoQuery.setPageSize(Constants.INIT_PAGESIZE);
			customerScoreInfoQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
		}
		try {
			page = customerScoreService.queryPage(customerScoreInfoQuery);
		} catch (Exception e) {
			addActionError(e.getMessage());
			log.error("查询信息异常", e);
		}

		return LIST;
	}

	public CustomerScoreInfo getCustomerScoreInfo() {
		return customerScoreInfo;
	}

	public void setCustomerScoreInfo(CustomerScoreInfo customerScoreInfo) {
		this.customerScoreInfo = customerScoreInfo;
	}

	public CustomerScoreInfo getCustomerScoreInfoQuery() {
		return customerScoreInfoQuery;
	}

	public void setCustomerScoreInfoQuery(
			CustomerScoreInfo customerScoreInfoQuery) {
		this.customerScoreInfoQuery = customerScoreInfoQuery;
	}

	public Pagination<?> getPage() {
		return page;
	}

	public void setPage(Pagination<?> page) {
		this.page = page;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
